package utils;

import java.util.PriorityQueue;
import java.util.Vector;

public class PriorityQueueNoDupes<E> extends PriorityQueue<E> {
	Vector<E> nodes;
	public PriorityQueueNoDupes() {
		super();
		nodes = new Vector<E>();
	}

	public boolean add(E e) {
		//System.out.println("adding "+e+super.contains(e));
		
		boolean isAdded = false;
		if (!super.contains(e)){//&&!nodes.contains(e)) {
			isAdded = super.add(e);
			nodes.add(e);
		}
		//System.out.println(isAdded);
		return isAdded;
	}
}
